<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        html {
            font-size: 50px;
        }
        li {
            width: 1rem;
            height: 1rem;
            background-color: red;
            margin-top: .2rem;
        }
    </style>
</head>
<body onload="fun()">
    <ul>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
    </ul>
</body>
<script>
    function fun() {
        window.addEventListener('resize', function() {
                var width = docEl.clientWidth / 7.5;
                docEl.style.fontSize = width + "px"
        })
    }
</script>
</html>